<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow: flow::net_flow::Sequence_number::Generator Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow project: Full implementation reference.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceflow.html">flow</a></li><li class="navelem"><a class="el" href="namespaceflow_1_1net__flow.html">net_flow</a></li><li class="navelem"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number.html">Sequence_number</a></li><li class="navelem"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html">Generator</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="#pri-static-attribs">Static Private Attributes</a> &#124;
<a href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">flow::net_flow::Sequence_number::Generator Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>An object of this type generates a series of initial sequence numbers (ISN) that are meant to be sufficiently secure to protect against ISN attacks and confusion among different connections between the same endpoints occurring in series.  
 <a href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="seq__num_8hpp_source.html">seq_num.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for flow::net_flow::Sequence_number::Generator:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classflow_1_1net__flow_1_1Sequence__number_1_1Generator__inherit__graph.svg" width="310" height="119"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for flow::net_flow::Sequence_number::Generator:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classflow_1_1net__flow_1_1Sequence__number_1_1Generator__coll__graph.svg" width="1610" height="448"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8c0005053088c63c912655222791dd7d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a8c0005053088c63c912655222791dd7d">Generator</a> (<a class="el" href="classflow_1_1log_1_1Logger.html">log::Logger</a> *logger)</td></tr>
<tr class="memdesc:a8c0005053088c63c912655222791dd7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs <a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html" title="An object of this type generates a series of initial sequence numbers (ISN) that are meant to be suff...">Generator</a>.  <a href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a8c0005053088c63c912655222791dd7d">More...</a><br /></td></tr>
<tr class="separator:a8c0005053088c63c912655222791dd7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06f094532f4be6ab3b69d27ea39b2d4d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number.html">Sequence_number</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a06f094532f4be6ab3b69d27ea39b2d4d">generate_init_seq_num</a> ()</td></tr>
<tr class="memdesc:a06f094532f4be6ab3b69d27ea39b2d4d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an initial sequence number (ISN) for use in a new connection.  <a href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a06f094532f4be6ab3b69d27ea39b2d4d">More...</a><br /></td></tr>
<tr class="separator:a06f094532f4be6ab3b69d27ea39b2d4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classflow_1_1log_1_1Log__context"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classflow_1_1log_1_1Log__context')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classflow_1_1log_1_1Log__context.html">flow::log::Log_context</a></td></tr>
<tr class="memitem:ae7100d2dd130d8f130e3e64fdb1f4fd9 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Log__context.html#ae7100d2dd130d8f130e3e64fdb1f4fd9">Log_context</a> (<a class="el" href="classflow_1_1log_1_1Logger.html">Logger</a> *logger=0)</td></tr>
<tr class="memdesc:ae7100d2dd130d8f130e3e64fdb1f4fd9 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs <a class="el" href="classflow_1_1log_1_1Log__context.html" title="Convenience class that simply stores a Logger and/or Component passed into a constructor; and returns...">Log_context</a> by storing the given pointer to a <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> and a null <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a>.  <a href="classflow_1_1log_1_1Log__context.html#ae7100d2dd130d8f130e3e64fdb1f4fd9">More...</a><br /></td></tr>
<tr class="separator:ae7100d2dd130d8f130e3e64fdb1f4fd9 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1ac7f30ab442c3c6aa6079335df6c9a inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memTemplParams" colspan="2">template&lt;typename Component_payload &gt; </td></tr>
<tr class="memitem:af1ac7f30ab442c3c6aa6079335df6c9a inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Log__context.html#af1ac7f30ab442c3c6aa6079335df6c9a">Log_context</a> (<a class="el" href="classflow_1_1log_1_1Logger.html">Logger</a> *logger, Component_payload component_payload)</td></tr>
<tr class="memdesc:af1ac7f30ab442c3c6aa6079335df6c9a inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs <a class="el" href="classflow_1_1log_1_1Log__context.html" title="Convenience class that simply stores a Logger and/or Component passed into a constructor; and returns...">Log_context</a> by storing the given pointer to a <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> and a new <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> storing the specified generically typed payload (an <code>enum</code> value).  <a href="classflow_1_1log_1_1Log__context.html#af1ac7f30ab442c3c6aa6079335df6c9a">More...</a><br /></td></tr>
<tr class="separator:af1ac7f30ab442c3c6aa6079335df6c9a inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c57a7f44959a01ca9a1c948a6686cc0 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Log__context.html#a5c57a7f44959a01ca9a1c948a6686cc0">Log_context</a> (const <a class="el" href="classflow_1_1log_1_1Log__context.html">Log_context</a> &amp;src)</td></tr>
<tr class="memdesc:a5c57a7f44959a01ca9a1c948a6686cc0 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor that stores equal <code>Logger*</code> and <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> values as the source.  <a href="classflow_1_1log_1_1Log__context.html#a5c57a7f44959a01ca9a1c948a6686cc0">More...</a><br /></td></tr>
<tr class="separator:a5c57a7f44959a01ca9a1c948a6686cc0 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d4e624833d96bdafa1485ffff472509 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Log__context.html#a3d4e624833d96bdafa1485ffff472509">Log_context</a> (<a class="el" href="classflow_1_1log_1_1Log__context.html">Log_context</a> &amp;&amp;src)</td></tr>
<tr class="memdesc:a3d4e624833d96bdafa1485ffff472509 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move constructor that makes this equal to <code>src</code>, while the latter becomes as-if default-constructed.  <a href="classflow_1_1log_1_1Log__context.html#a3d4e624833d96bdafa1485ffff472509">More...</a><br /></td></tr>
<tr class="separator:a3d4e624833d96bdafa1485ffff472509 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d628315d5a93908d47a281980d3113e inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1log_1_1Log__context.html">Log_context</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Log__context.html#a5d628315d5a93908d47a281980d3113e">operator=</a> (const <a class="el" href="classflow_1_1log_1_1Log__context.html">Log_context</a> &amp;src)</td></tr>
<tr class="memdesc:a5d628315d5a93908d47a281980d3113e inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator that behaves similarly to the copy constructor.  <a href="classflow_1_1log_1_1Log__context.html#a5d628315d5a93908d47a281980d3113e">More...</a><br /></td></tr>
<tr class="separator:a5d628315d5a93908d47a281980d3113e inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae857197aecba8606c32296bc7bec308 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1log_1_1Log__context.html">Log_context</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Log__context.html#aae857197aecba8606c32296bc7bec308">operator=</a> (<a class="el" href="classflow_1_1log_1_1Log__context.html">Log_context</a> &amp;&amp;src)</td></tr>
<tr class="memdesc:aae857197aecba8606c32296bc7bec308 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move assignment operator that behaves similarly to the move constructor.  <a href="classflow_1_1log_1_1Log__context.html#aae857197aecba8606c32296bc7bec308">More...</a><br /></td></tr>
<tr class="separator:aae857197aecba8606c32296bc7bec308 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6bb8e4250586425631ef80063caf155 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Log__context.html#aa6bb8e4250586425631ef80063caf155">swap</a> (<a class="el" href="classflow_1_1log_1_1Log__context.html">Log_context</a> &amp;other)</td></tr>
<tr class="memdesc:aa6bb8e4250586425631ef80063caf155 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="mdescLeft">&#160;</td><td class="mdescRight">Swaps <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> pointers and <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> objects held by <code>*this</code> and <code>other</code>.  <a href="classflow_1_1log_1_1Log__context.html#aa6bb8e4250586425631ef80063caf155">More...</a><br /></td></tr>
<tr class="separator:aa6bb8e4250586425631ef80063caf155 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4db395042b065b00398cd59845dcb4d inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1log_1_1Logger.html">Logger</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Log__context.html#af4db395042b065b00398cd59845dcb4d">get_logger</a> () const</td></tr>
<tr class="memdesc:af4db395042b065b00398cd59845dcb4d inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the stored <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> pointer, particularly as many <code>FLOW_LOG_*()</code> macros expect.  <a href="classflow_1_1log_1_1Log__context.html#af4db395042b065b00398cd59845dcb4d">More...</a><br /></td></tr>
<tr class="separator:af4db395042b065b00398cd59845dcb4d inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a5fef42dc2cedf3c0d1a6e83beb2948 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Log__context.html#a8a5fef42dc2cedf3c0d1a6e83beb2948">get_log_component</a> () const</td></tr>
<tr class="memdesc:a8a5fef42dc2cedf3c0d1a6e83beb2948 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns reference to the stored <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> object, particularly as many <code>FLOW_LOG_*()</code> macros expect.  <a href="classflow_1_1log_1_1Log__context.html#a8a5fef42dc2cedf3c0d1a6e83beb2948">More...</a><br /></td></tr>
<tr class="separator:a8a5fef42dc2cedf3c0d1a6e83beb2948 inherit pub_methods_classflow_1_1log_1_1Log__context"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a280938c90324ee29507c14e51afea1d9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number.html">Sequence_number</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a280938c90324ee29507c14e51afea1d9">m_last_init_seq_num</a></td></tr>
<tr class="memdesc:a280938c90324ee29507c14e51afea1d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">The last initial sequence number returned by <a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a06f094532f4be6ab3b69d27ea39b2d4d" title="Returns an initial sequence number (ISN) for use in a new connection.">generate_init_seq_num()</a> (or zero if never called).  <a href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a280938c90324ee29507c14e51afea1d9">More...</a><br /></td></tr>
<tr class="separator:a280938c90324ee29507c14e51afea1d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a5d72155fe52f9b72860dd69fec6b9e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceflow.html#a9d9cc2eeb10d398cff5591d446b763b8">Fine_time_pt</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a8a5d72155fe52f9b72860dd69fec6b9e">m_last_isn_generation</a></td></tr>
<tr class="memdesc:a8a5d72155fe52f9b72860dd69fec6b9e"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="namespaceflow.html#a8f2e48761f9ca3ffcaa29872078bbf00" title="Clock used for delicate time measurements, such that the now() method gets the current time relative ...">Fine_clock</a> time of the last invocation of <a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a06f094532f4be6ab3b69d27ea39b2d4d" title="Returns an initial sequence number (ISN) for use in a new connection.">generate_init_seq_num()</a> (or default if never called).  <a href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a8a5d72155fe52f9b72860dd69fec6b9e">More...</a><br /></td></tr>
<tr class="separator:a8a5d72155fe52f9b72860dd69fec6b9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-static-attribs" name="pri-static-attribs"></a>
Static Private Attributes</h2></td></tr>
<tr class="memitem:a94493589766b7ae9340a31807bdf4710"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="classflow_1_1net__flow_1_1Sequence__number.html#ab307e12c0cf8cefbe7fb1ec8588af2a8">seq_num_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a94493589766b7ae9340a31807bdf4710">S_MAX_INIT_SEQ_NUM</a> = std::numeric_limits&lt;<a class="el" href="classflow_1_1net__flow_1_1Sequence__number.html#ab307e12c0cf8cefbe7fb1ec8588af2a8">seq_num_t</a>&gt;::max() / 2</td></tr>
<tr class="memdesc:a94493589766b7ae9340a31807bdf4710"><td class="mdescLeft">&#160;</td><td class="mdescRight">The maximum allowed value for the initial sequence number (ISN) for a given Flow-protocol connection (<a class="el" href="classflow_1_1net__flow_1_1Peer__socket.html" title="A peer (non-server) socket operating over the Flow network protocol, with optional stream-of-bytes an...">Peer_socket</a>).  <a href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a94493589766b7ae9340a31807bdf4710">More...</a><br /></td></tr>
<tr class="separator:a94493589766b7ae9340a31807bdf4710"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9aed10ea9740d60e1fd4de5de05b485b"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="namespaceflow.html#a48799f1263cdeedec125be51a3db2b79">Fine_duration</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a9aed10ea9740d60e1fd4de5de05b485b">S_TIME_PER_SEQ_NUM</a> = boost::chrono::microseconds(4)</td></tr>
<tr class="memdesc:a9aed10ea9740d60e1fd4de5de05b485b"><td class="mdescLeft">&#160;</td><td class="mdescRight">The ISN given out at a given time should increment every N; this is the value of N.  <a href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a9aed10ea9740d60e1fd4de5de05b485b">More...</a><br /></td></tr>
<tr class="separator:a9aed10ea9740d60e1fd4de5de05b485b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a585fba13c0fc74e626313ba61a725413"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="namespaceflow.html#a48799f1263cdeedec125be51a3db2b79">Fine_duration</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a585fba13c0fc74e626313ba61a725413">S_MIN_DELAY_BETWEEN_ISN</a> = boost::chrono::milliseconds(500)</td></tr>
<tr class="memdesc:a585fba13c0fc74e626313ba61a725413"><td class="mdescLeft">&#160;</td><td class="mdescRight">In addition to the actual time passed between two ISN generations, pretend this much additional time has also passed.  <a href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a585fba13c0fc74e626313ba61a725413">More...</a><br /></td></tr>
<tr class="separator:a585fba13c0fc74e626313ba61a725413"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >An object of this type generates a series of initial sequence numbers (ISN) that are meant to be sufficiently secure to protect against ISN attacks and confusion among different connections between the same endpoints occurring in series. </p>
<p >The basic use case is to construct a <a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html" title="An object of this type generates a series of initial sequence numbers (ISN) that are meant to be suff...">Generator</a> at the beginning of a <a class="el" href="classflow_1_1net__flow_1_1Node.html" title="An object of this class is a single Flow-protocol networking node, in the sense that: (1) it has a di...">Node</a>'s operation to initialize its state and then call <a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a06f094532f4be6ab3b69d27ea39b2d4d" title="Returns an initial sequence number (ISN) for use in a new connection.">generate_init_seq_num()</a> whenever an ISN is needed.</p>
<h3>Thread safety</h3>
<p >Not safe to read/write or write/write one object simultaneously. </p>

<p class="definition">Definition at line <a class="el" href="seq__num_8hpp_source.html#l00370">370</a> of file <a class="el" href="seq__num_8hpp_source.html">seq_num.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a8c0005053088c63c912655222791dd7d" name="a8c0005053088c63c912655222791dd7d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c0005053088c63c912655222791dd7d">&#9670;&nbsp;</a></span>Generator()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">flow::net_flow::Sequence_number::Generator::Generator </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classflow_1_1log_1_1Logger.html">log::Logger</a> *&#160;</td>
          <td class="paramname"><em>logger</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs <a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html" title="An object of this type generates a series of initial sequence numbers (ISN) that are meant to be suff...">Generator</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">logger</td><td>Logger to use subsequently. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="seq__num_8cpp_source.html#l00042">42</a> of file <a class="el" href="seq__num_8cpp_source.html">seq_num.cpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a06f094532f4be6ab3b69d27ea39b2d4d" name="a06f094532f4be6ab3b69d27ea39b2d4d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a06f094532f4be6ab3b69d27ea39b2d4d">&#9670;&nbsp;</a></span>generate_init_seq_num()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number.html">Sequence_number</a> flow::net_flow::Sequence_number::Generator::generate_init_seq_num </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns an initial sequence number (ISN) for use in a new connection. </p>
<dl class="section return"><dt>Returns</dt><dd>Ditto. </dd></dl>

<p class="definition">Definition at line <a class="el" href="seq__num_8cpp_source.html#l00048">48</a> of file <a class="el" href="seq__num_8cpp_source.html">seq_num.cpp</a>.</p>

<p class="reference">References <a class="el" href="log_8hpp_source.html#l00227">FLOW_LOG_TRACE</a>.</p>

<p class="reference">Referenced by <a class="el" href="server__socket_8cpp_source.html#l00430">flow::net_flow::Node::handle_syn_to_listening_server()</a>.</p>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classflow_1_1net__flow_1_1Sequence__number_1_1Generator_a06f094532f4be6ab3b69d27ea39b2d4d_icgraph.svg" width="990" height="90"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a280938c90324ee29507c14e51afea1d9" name="a280938c90324ee29507c14e51afea1d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a280938c90324ee29507c14e51afea1d9">&#9670;&nbsp;</a></span>m_last_init_seq_num</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classflow_1_1net__flow_1_1Sequence__number.html">Sequence_number</a> flow::net_flow::Sequence_number::Generator::m_last_init_seq_num</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The last initial sequence number returned by <a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a06f094532f4be6ab3b69d27ea39b2d4d" title="Returns an initial sequence number (ISN) for use in a new connection.">generate_init_seq_num()</a> (or zero if never called). </p>

<p class="definition">Definition at line <a class="el" href="seq__num_8hpp_source.html#l00419">419</a> of file <a class="el" href="seq__num_8hpp_source.html">seq_num.hpp</a>.</p>

</div>
</div>
<a id="a8a5d72155fe52f9b72860dd69fec6b9e" name="a8a5d72155fe52f9b72860dd69fec6b9e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a5d72155fe52f9b72860dd69fec6b9e">&#9670;&nbsp;</a></span>m_last_isn_generation</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceflow.html#a9d9cc2eeb10d398cff5591d446b763b8">Fine_time_pt</a> flow::net_flow::Sequence_number::Generator::m_last_isn_generation</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="namespaceflow.html#a8f2e48761f9ca3ffcaa29872078bbf00" title="Clock used for delicate time measurements, such that the now() method gets the current time relative ...">Fine_clock</a> time of the last invocation of <a class="el" href="classflow_1_1net__flow_1_1Sequence__number_1_1Generator.html#a06f094532f4be6ab3b69d27ea39b2d4d" title="Returns an initial sequence number (ISN) for use in a new connection.">generate_init_seq_num()</a> (or default if never called). </p>

<p class="definition">Definition at line <a class="el" href="seq__num_8hpp_source.html#l00422">422</a> of file <a class="el" href="seq__num_8hpp_source.html">seq_num.hpp</a>.</p>

</div>
</div>
<a id="a94493589766b7ae9340a31807bdf4710" name="a94493589766b7ae9340a31807bdf4710"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a94493589766b7ae9340a31807bdf4710">&#9670;&nbsp;</a></span>S_MAX_INIT_SEQ_NUM</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classflow_1_1net__flow_1_1Sequence__number.html#ab307e12c0cf8cefbe7fb1ec8588af2a8">Sequence_number::seq_num_t</a> flow::net_flow::Sequence_number::Generator::S_MAX_INIT_SEQ_NUM = std::numeric_limits&lt;<a class="el" href="classflow_1_1net__flow_1_1Sequence__number.html#ab307e12c0cf8cefbe7fb1ec8588af2a8">seq_num_t</a>&gt;::max() / 2</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The maximum allowed value for the initial sequence number (ISN) for a given Flow-protocol connection (<a class="el" href="classflow_1_1net__flow_1_1Peer__socket.html" title="A peer (non-server) socket operating over the Flow network protocol, with optional stream-of-bytes an...">Peer_socket</a>). </p>
<p >This should be high enough to allow a huge range of possible initial sequence numbers (to guard against ISN attacks, for example); but low enough to ensure that sequence numbers following the ISN within the given connection would take an extremely huge amount of time to wrap (i.e., overflow Sequence_numer::seq_num_t). If such a value is chosen, the ISN can be secure and remove the need to worry about wrapping as well. </p>

<p class="definition">Definition at line <a class="el" href="seq__num_8hpp_source.html#l00405">405</a> of file <a class="el" href="seq__num_8hpp_source.html">seq_num.hpp</a>.</p>

</div>
</div>
<a id="a585fba13c0fc74e626313ba61a725413" name="a585fba13c0fc74e626313ba61a725413"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a585fba13c0fc74e626313ba61a725413">&#9670;&nbsp;</a></span>S_MIN_DELAY_BETWEEN_ISN</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="namespaceflow.html#a48799f1263cdeedec125be51a3db2b79">Fine_duration</a> flow::net_flow::Sequence_number::Generator::S_MIN_DELAY_BETWEEN_ISN = boost::chrono::milliseconds(500)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>In addition to the actual time passed between two ISN generations, pretend this much additional time has also passed. </p>

<p class="definition">Definition at line <a class="el" href="seq__num_8hpp_source.html#l00414">414</a> of file <a class="el" href="seq__num_8hpp_source.html">seq_num.hpp</a>.</p>

</div>
</div>
<a id="a9aed10ea9740d60e1fd4de5de05b485b" name="a9aed10ea9740d60e1fd4de5de05b485b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9aed10ea9740d60e1fd4de5de05b485b">&#9670;&nbsp;</a></span>S_TIME_PER_SEQ_NUM</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="namespaceflow.html#a48799f1263cdeedec125be51a3db2b79">Fine_duration</a> flow::net_flow::Sequence_number::Generator::S_TIME_PER_SEQ_NUM = boost::chrono::microseconds(4)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The ISN given out at a given time should increment every N; this is the value of N. </p>

<p class="definition">Definition at line <a class="el" href="seq__num_8hpp_source.html#l00408">408</a> of file <a class="el" href="seq__num_8hpp_source.html">seq_num.hpp</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>net_flow/detail/<a class="el" href="seq__num_8hpp_source.html">seq_num.hpp</a></li>
<li>net_flow/detail/<a class="el" href="seq__num_8cpp_source.html">seq_num.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 28 2025 22:55:36 for Flow by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
